import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        phonenum: '', //初始状态下的手机号
        username: '', //初始状态下的用户名
        coin: '', //金币数量
        id: '', //id
        bingon: true //是否绑定牙刷
    },
    getters: {
        getphonenum(state) {
            return state.phonenum
        }
    },
    mutations: {
        setphonenum(state, num) {
            state.phonenum = num
        },
        getusername(state, name) {
            state.username = name
        },
        getcoin(state, coin) {
            state.coin = coin
        },
        getId(state, id) {
            state.id = id
        },
        getBindon(state, bindon) {
            state.bindon = bindon
        }
    },
    actions: {},
    modules: {}
})